//
//  TitleCollectionViewCell.m
//  XWZ_News_Work
//
//  Created by dllo on 16/1/16.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TitleCollectionViewCell.h"

@implementation TitleCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubview];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.contentView.layer.cornerRadius = 5.0;
    [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.equalTo(self.contentView.mas_width).with.offset(10);
        make.height.equalTo(self.contentView.mas_height).with.offset(10);
        
        
    }];
    
    [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView.mas_centerX);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.mas_equalTo(@20);
        make.height.mas_equalTo(@20);
        
        
    }];
    

    
    





}

- (void)createSubview
{
    self.backgroundColor = [UIColor colorWithRed:241.0 / 255.0 green:241.0 / 255.0 blue:241.0 / 255.0 alpha:1.0];
   
    
    self.label = [[UILabel alloc] init];
    self.label.textAlignment = NSTextAlignmentCenter;
    self.label.text = @"网易";
    [self.contentView addSubview:self.label];

//    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
//    [self.button setImage:[UIImage imageNamed:@"iconfont-shanchu"] forState:UIControlStateNormal];
//    [self.button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
//    self.button.backgroundColor = [UIColor redColor];
//    //            self.button.hidden = YES;
//    [self.contentView addSubview:self.button];
//
    
    
}

- (void)buttonAction:(UIButton *)sender
{
    NSLog(@"33333");
}

@end
